import Vue from 'vue'
import Router from 'vue-router'
import App from '@/App.vue'
import Home from '@/views/Home/home.vue'
const overview = () => import('@/views/Home/overview.vue')
const maintain = () => import('@/views/Home/maintain.vue')
const warning = () => import('@/views/Home/warning.vue')
const house = () => import('@/views/Home/house.vue')
const loss = () => import('@/views/Home/loss.vue')
const monitor = () => import('@/views/Home/monitor.vue')
const alarmList = () => import('@/views/Home/alarmList.vue')
const buttons = () => import('@/views/Assembly/buttons.vue')
const operation = () => import('@/views/Assembly/operation.vue')
// import Auto from './auto'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: App,
      children: [
        {
          path: '/home', // 主页面
          components: { default: Home },
          meta: { title: '首页', fullPath: 'home.vue' },
        },
        {
          path: '/overview',
          components: { default: overview },
          meta: { title: '总览信息', fullPath: 'overview.vue' },
        },
        {
          path: '/maintain',
          components: { default: maintain },
          meta: { title: '用户占比/异常分析', fullPath: 'maintain.vue' },
        },
        {
          path: '/warning',
          components: { default: warning },
          meta: { title: '异常对比', fullPath: 'warning.vue' },
        },
        {
          path: '/monitor',
          components: { default: monitor },
          meta: { title: '实时监测', fullPath: 'monitor.vue' },
        },
        {
          path: '/house',
          components: { default: house },
          meta: { title: '能耗对比 ', fullPath: 'house.vue' },
        },
        {
          path: '/loss',
          components: { default: loss },
          meta: { title: '近三十天异常报警占比', fullPath: 'loss.vue' },
        },
        {
          path: '/alarmList',
          components: { default: alarmList },
          meta: { title: '报警列表', fullPath: 'alarmList.vue' },
        },
        {
          path: '/buttons',
          components: { default: buttons },
          meta: { title: '按钮组件', fullPath: 'buttons.vue' },
        },
        {
          path: '/operation',
          components: { default: operation },
          meta: { title: '操作组件', fullPath: 'operation.vue' },
        },
      ],
    },
  ],
})
